package com.ruoyi.zq.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * TODO
 *
 * @Author: LoneyFeather
 * @Date: Created in 14:52 2022/1/12
 */
@Mapper
@Repository
public interface CommonUtilsMapper {


    @Select("<script>" +
            "select sr.role_key\n" +
            "from sys_user su\n" +
            "left join sys_user_role sur on sur.user_id = su.user_id\n" +
            "left join sys_role sr on sur.role_id = sr.role_id\n" +
            "where su.del_flag = '0'\n" +
            "and sr.del_flag = '0'\n" +
            "and su.user_id = #{userId} " +
            "</script>")
    List<String> roleKey(@Param("userId") Long userId);

}
